﻿using NetSurveillance.WebApp.DataServices.Models;
using ServiceStack.OrmLite;

namespace NetSurveillance.WebApp.DataServices.Implementations
{
    public class TaskSettingService : BaseService<TaskSetting>
    {
       public TaskSettingService(string connStr, IOrmLiteDialectProvider provider = null)
           : base(connStr, provider)
        {
        }

        public TaskSetting GetTaskSetting(long taskId)
        {
            using (var db = DbFactory.OpenDbConnection())
            {
                var taskSetting = db.FirstOrDefault<TaskSetting>(p => p.TaskId == taskId);
                return taskSetting;
            }
        }
    }
}
